<style>
   .row{margin-bottom: 20px;}
   input[type="file"] {
       position: absolute;
       top: 0;
       opacity: 0;
       width: 100px;
       height: 35px;
       left: 15px;
   }
    table th.url{width:500px !important;}
    table td{word-break: break-all}

</style>
<section class="content">
    <div class="table-box">
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th>序号</th>
                    <th>类别</th>
                    <th>标题</th>
                    <th class="url">链接</th>
                    <th>时间</th>
                    <th>作者</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="n in knowledgeList">
                    <td>{{$index+1}}</td>
                    <td>{{n.category}}</td>
                    <td>{{n.title}}</td>
                    <td>{{n.url}}</td>
                    <td>{{n.publishTime | date:"yyyy-MM-dd HH:mm:ss"}}</td>
                    <td>{{n.author}}</td>
                    <td>

                        <a ng-if="n.status=='enable'" href="javascript:;" ng-click="disEnable($event)" data-rowId="{{n.wxInformationId}}">禁用</a>
                        <a ng-if="n.status!='enable'" href="javascript:;" ng-click="enable($event)" data-rowId="{{n.wxInformationId}}">启用</a> |
                        <a href="javascript:;" ng-click="setTop($event)" data-rowId="{{n.wxInformationId}}">置顶</a> |
                        <a href="javascript:;" ng-click="showDetail($event)" data-detail="{{n}}"  data-toggle="modal" data-target="#myModal">编辑</a> |
                        <a href="javascript:;" ng-click="del($event)" data-rowId="{{n.wxInformationId}}">删除</a>
                    </td>
                </tr>
                <tr ng-if="knowledgeList.length<=0">
                    <td colspan="10" class="text-center">暂无数据</td>
                </tr>
                <tr>
                    <td style="cursor: pointer" ng-click="showDetail($event)" colspan="10" data-toggle="modal" data-target="#myModal">✚新增</td>
                </tr>

                </tbody>
            </table>
            <div class="page-function" ng-if="knowledgeList.length>0">
            </div>
        </div>
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content" style="width: 800px;">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel">
                        新增|编辑
                    </h4>
                </div>
                <div class="modal-body">
                    <div class="row">
                        <div class="col-xs-2">类别</div>
                        <div class="col-xs-9">
                            <select  class="form-control" name="cate">
                                <option value="">请选择类别</option>
                                <option ng-repeat="n in category" value="{{n.smDictEnumRowId}}" data-text="{{n.desc}}">{{n.desc}}</option>
                            </select>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-xs-2">标题</div>
                        <div class="col-xs-9">
                            <input type="text"  value="{{addKnowledgeModel.title}}" class="form-control" ng-model="addKnowledgeModel.title">
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-xs-2">链接</div>
                        <div class="col-xs-9">
                            <input type="text"  value="{{addKnowledgeModel.url}}" class="form-control" ng-model="addKnowledgeModel.url">
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-xs-2">作者</div>
                        <div class="col-xs-9">
                            <input type="text"  value="{{addKnowledgeModel.author}}" class="form-control" ng-model="addKnowledgeModel.author"  >
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-xs-2">摘要</div>
                        <div class="col-xs-9">
                            <!--<input type="text"  value="" class="form-control"   >-->
                            <textarea cols="78" rows="5" ng-model="addKnowledgeModel.description">{{addKnowledgeModel.description}}</textarea>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-xs-3">封面图片</div>
                        <div class="col-xs-6 col-xs-offset-1" style="margin-left: 90px;">
                            <a href="javascript:;" class="btn btn-primary btn" role="button">上传图片
                                　<input type="file" onchange="angular.element(this).scope().uploadImg(this,'img')">
                            </a>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-xs-4 col-xs-offset-4">
                            <img src="./img/img-cover.png" alt="" class="imgCover"  ng-if="!addKnowledgeModel.coverImgUrl" width="200px" height="200px">
                            <img src="{{basePictureUrl + addKnowledgeModel.coverImgUrl}}" alt="" class="imgCover"  ng-if="addKnowledgeModel.coverImgUrl" width="200px" height="200px">
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">重置
                    </button>
                    <button type="button" class="btn btn-primary" ng-click="commit()">保存</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
</section>